<extend name="common:base" />
<block name="content">
    <div id="header">
        <div class="header">
            <h1 class="tit">设置</h1>
        </div>
    </div>
    <div class="sz-a">
        <div class="sz-a1">
            <!--<a href="{:U('Setting/edit_message')}">-->
            <div class="sz-a-img">
                <if condition="$self['avatar'] neq ''">
                    <img src="{$self['avatar']}">
                <else/>
                    <img src="{:C('__STATIC__')}{$theme}/Static/img/ym.jpg">
                </if>
            </div>
            <div class="sz-a1-div">
                <span>{$self["agent_name"]}</span>
                <span>{$self['signature']|mb_substr=0,15,'utf-8'}...</span>
            </div>
            <!--</a>-->
        </div>


        <div class="sz-a2">

            <if condition="session('is_agent') eq 1">
            <a class="wdd" href="{:U('Setting/brand_view')}">
                <div class="sz-a2-div1">
                    <p class="sz-p1">代理品牌</p>
                    <p class="sz-p2">查看&nbsp;<img src="{:C('__STATIC__')}{$theme}/Static/img/tj.jpg"></p>
                </div>
            </a>
        </if>

            <a class="wdd" href="{:U('Setting/agent_address')}">
                <div class="sz-a2-div1">
                    <p class="sz-p1">收货地址</p>
                    <p class="sz-p2">查看&nbsp;<img src="{:C('__STATIC__')}{$theme}/Static/img/tj.jpg"></p>
                </div>
            </a>

            <a class="wdd" href="{:U('Setting/edit_pass')}">
                <div class="sz-a2-div1">
                    <p class="sz-p1">密码</p>
                    <p class="sz-p2">******&nbsp;<img src="{:C('__STATIC__')}{$theme}/Static/img/tj.jpg"></p>
                </div>
            </a>


            <a href="{:U('Setting/edit_mobile')}">
                <div class="sz-a2-div1">
                    <p class="sz-p1">账号绑定</p>
                    <p class="sz-p2">{$self["mobile"]}&nbsp;<img src="{:C('__STATIC__')}{$theme}/Static/img/tj.jpg"></p>
                </div>
            </a>

            <if condition="$recommend neq '0'">
                <a href="{:U('Setting/invitation')}">
                    <div class="sz-a2-div1" style="border-bottom: none;">
                        <p class="sz-p1">推荐用户</p>
                        <p class="sz-p2">{$recommend}&nbsp;<img src="{:C('__STATIC__')}{$theme}/Static/img/tj.jpg"></p>
                    </div>
                </a>
            <else/>
                <div class="sz-a2-div1" style="border-bottom: none;">
                    <p class="sz-p1">推荐用户</p>
                    <p class="sz-p2">{$recommend}&nbsp;<img src="{:C('__STATIC__')}{$theme}/Static/img/tj.jpg"></p>
                </div>
            </if>


        </div>
    </div>
    <div class="sz-b">
        <a href="javascript:;" id="logout">退出当前用户</a>
    </div>
</block>
<block name="CSS">
    <link rel="stylesheet" href="{:C('__STATIC__')}{$theme}/Static/{:C('css')}/total.css" />
</block>
<block name="JS">
    <script type="text/javascript">
        $(function() {
            $('#logout').click(function () {
                $.ajax({
                    url: "{:U('Login/logout')}",
                    type: 'POST',
                    beforeSend: function () {
                      layer.msg('退出中..');
                    },
                    success: function (msg) {
                        window.location.href = "{:U('Login/index', array('shop_id'=>session('url_shop_id')))}";
                    }
                });
            });
        });
    </script>
</block>
